<!-- src/views/main.vue -->
<template>
  <el-container class="app-container">
    <el-aside :width="isCollapse ? '64px' : '200px'">
      <Sidebar :collapse="isCollapse" />
    </el-aside>
    <el-container>
      <el-header>
        <Header :collapse="isCollapse" @toggle-collapse="isCollapse = !isCollapse" />
      </el-header>
      <el-main>
        <router-view />
      </el-main>
    </el-container>
  </el-container>
</template>

<script setup lang="ts">
import { ref } from 'vue'
import Sidebar from '@/components/Sidebar.vue'
import Header from '@/components/Header.vue'

const isCollapse = ref(false)
</script>

<style scoped>
.app-container {
  height: 100vh;
}
.el-aside {
  background-color: #304156;
  color: #fff;
  transition: width 0.3s;
}
.el-header {
  background-color: #fff;
  border-bottom: 1px solid #e6e6e6;
  padding: 0;
}
.el-main {
  background-color: #f0f2f5;
  padding: 20px;
}
</style>
